A portion of the disclosure of this patent document contains material that is subject to copyright protection. The copyright owner has no objection to the facsimile reproduction by anyone of the patent disclosure, as it appears in the Patent and Trademark Office patent files or records, but otherwise reserves all copyright rights whatsoever.
This application relates to the following co-pending application, assigned to the same assignee hereof, which is incorporated herein by reference.
U.S. Ser. No. 09/676,289, entitled A METHOD FOR SYNCHRONIZING JAVA WITH UML IN A VERSION CONFIGURATION MANAGEMENT SYSTEM;
U.S. Ser. No. 09/676,288, entitled A COMPUTER-IMPLEMENTED METHOD FOR GENERATING JAVA USING FROM A UML REPRESENTATION; and,
U.S. Ser. No. 09/676,284 entitled A METHOD FOR SYNCHRONIZING UML WITH JAVA IN A VERSION CONFIGURATION MANAGEMENT SYSTEM.
The present invention generally relates to software programming and in particular to a method for representing JAVA with the use of UML compliant tools.
UML is a diagrammatic language and by using any modeling tool that supports UML, UML models can be visually represented to a user. UML enables users to see what a particular program looks like in model form.
JAVA, on the other hand, is not diagrammatic. A JAVA programmer""s view is limited to the JAVA code and program output. The user must create a separate UML model in order to obtain a visual representation of the JAVA code.
Accordingly, there is a need to translate and represent JAVA code in UML. This would allow JAVA programmers to diagram JAVA code without having to create a separate model. The translation and generation should be made possible at the class, package, and project levels.
There is also a need to generate JAVA code from UML. This would allow models existing within UML to be transformed into a JAVA implementation that is ready for compiling.
A parser and generator sit on top of a server within an object-oriented repository, such as UREP, which is available from the assignee hereof. The program imports code within a JAVA project to the server.
The program parses the Java code for each JAVA source file within a JAVA project. This is done by parsing class names, class attributes, field names, and other information from JAVA source files.
The parsed information is then mapped to UML constructs and stored in an extensible Markup Language Metadata Interchange (XMI) file. An XMI file is a representation of the UML. Using the XMI file, Rational Rose can display the UML representation of the JAVA classes, allowing users to see a visual model of the JAVA code.
When translating from JAVA to UML, parsing can occur at the project, package, and class levels. A source file is the base JAVA file. Classes can be logically grouped to form packages, and packages can be grouped to form Java projects.
A feature of the present invention resides in the ability to parse JAVA and generate UML in a distributed environment without being limited by an IDE implementation.
Still another feature of the present invention is the ability to transform JAVA with finer granularity by parsing JAVA at the class, package, and project level and generating UML representation of class, package, and project.
Another feature of the present invention is the ability to support any IDE from JAVA that supports Source Code Control (SCC) API.
A still further feature of the present invention is the ability to support XMI.
These and other objects, which will become apparent as the invention is described in detail below, are provided by a computer-implemented method for representing JAVA in UML in a computer system executing a repository program. The method comprises the steps of determining if a file is a JAVA package or project. If it is, then determining if there is a JAVA subpackage not represented in UML, and if so; recursively creating UML subpackages representing each nested JAVA subpackage. If it is determined that the file is not a JAVA package or project, then the method creates UML files representing each JAVA source file.
Still other objects, features and advantages of the present invention will become readily apparent to those skilled in the art from the following detailed description, wherein is shown and described only the preferred embodiment of the invention, simply by way of illustration of the best mode contemplated of carrying out the invention. As will be realized, the invention is capable of other and different embodiments, and its several details are capable of modifications in various obvious respects, all without departing from the invention. Accordingly, the drawings and description are to be regarded as illustrative in nature, and not as restrictive, and what is intended to be protected by Letters Patent is set forth in the appended claims. The present invention will become apparent when taken in conjunction with the following description and attached drawings, wherein like characters indicate like parts, and which drawings form a part of this application.